<?php
include("db/connect.php");
$sqlselectupdate="select * from product where pro_id='".$_POST["temp"]."'";
$queryselectupdate=mysql_query($sqlselectupdate);
$fetchselectupdate=mysql_fetch_array($queryselectupdate);
?>
<form id="fromInsert_Pro" name="fromInsert_Pro" method="post" action="Javascript:ajaxmanage(3,<?php echo $_POST["temp"]?>);">
  <p>ข้อมูลสินค้า</p>
  <table width="528" border="0">
    <tr>
      <td width="178">รหัสสินค้า</td>
      <td width="340"><input type="text" name="pro_id" id="pro_id" readonly value="<?php echo $fetchselectupdate["pro_id"]?>"/></td>
    </tr>
    <tr>
      <td>ชื่อสินค้า</td>
      <td><input name="pro_name" type="text" required id="pro_name" maxlength="13" readonly value="<?php echo $fetchselectupdate["pro_name"]?>"/></td>
    </tr>
    <tr>
      <td>ราคา</td>
      <td><input name="pro_price" type="text" id="pro_price" value="<?php echo $fetchselectupdate["pro_price"]?>" /></td>
    </tr>
    <tr>
      <td>รายละเอียดสินค้า</td>
      <td><textarea name="pro_detail" id="pro_detail" cols="45" rows="3"><?php echo $fetchselectupdate["pro_detail"]?></textarea></td>
    </tr>
  </table>
  <p align="center">
    <input type="submit" name="Submit" id="button" value="ตกลง" />
    <input type="reset" name="button2" id="button2" value="ยกเลิก" />
  </p>
  <p>&nbsp;</p>
</form>
<script>
function submitPro(){
	$.ajax({
			type:"POST",
			url:"insert_product2.php",
			data:$("#fromInsert_Pro").serialize(),
			success: function(msg){
				$("#spantest").html(msg);
				}
			});//ajax
	}
</script>
